package com.lagou.edu.controller;

import com.lagou.edu.cache.RedisService;
import com.lagou.edu.entity.Position;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author 陶肖寅
 * @version V1.0
 * <p>
 * date: 2020/9/6 下午5:46
 * email:fromlx@126.com
 * @Copyright: 2020-2021 城云科技(中国)有限公司
 * </p>
 */
@RestController
@EnableAutoConfiguration
@RequestMapping(value = "/position")
public class PositionController {

    @Autowired
    private RedisService rs;
    @GetMapping(value = "")
    public List<Position> getPositions() throws Exception {
        return rs.getHostList();
    }
}
